package com.bayern.muchen.blog.controller.management;

import com.bayern.muchen.blog.entity.User;
import com.bayern.muchen.blog.service.management.UserService;
import com.bayern.muchen.blog.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author QIUYANG
 * @title: UserController
 * @description: 用户登录管理
 * @date 2021/11/3014:54
 */
@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserLoginController {
    @Autowired
    UserService userService;

    @PostMapping("/insert")
    public R insertUser(@RequestBody User user){
        int result = userService.insertUser(user);
        if (result==0){
            return R.error(-1,"添加失败");
        }
        return R.ok();
    }

}
